package net.sourceforge.wurfl.core.handlers.matchers;

import java.util.SortedSet;

import net.sourceforge.wurfl.core.handlers.Handler;
import net.sourceforge.wurfl.core.utils.StringUtils;

/**
 * 
 * @author WURFL-PRO SRL, Rome, Italy
 */
public class AndroidMatcher extends AbstractMatcher  {

	public AndroidMatcher(Handler handler) {
		super(handler);
	}
	
	protected String lookForMatchingUserAgent(SortedSet userAgentsSet,
			String userAgent) {
		int tolerance = StringUtils.indexOfOrLength(userAgent, " ", StringUtils.indexOfOrLength(userAgent, "Android"));
		return StringUtils.risMatch(userAgentsSet, userAgent, tolerance);
	}

}
